package panel.getMore
{
	import assists.Lang;
	import assists.URI;
	import assists.resource.ResourceLoader;
	
	import flash.display.Sprite;
	import flash.display.Stage;
	
	import inerface.IGetMorePanel;
	
	import main.ClientConstants;
	
	import panel.eating.DragContainerBox;
	
	public class GetMorePanel extends Sprite implements IGetMorePanel
	{
		private var _stage:Stage;
		private var _loader:ResourceLoader;
		private var _lang:Lang;
		private var _uri:URI;
		
		private var container:DragContainerBox;
		private var boxList:GetMoreList;
		
		public function GetMorePanel()
		{
			super();
		}
		
		public function changeData(list:Array):void
		{
			boxList.changeData(list);
			
			container.changeData([boxList]);
		}
		
		public function init(stage:Stage, loader:ResourceLoader, lang:Lang, uri:URI=null):void
		{
			_stage = stage;
			_loader = loader;
			_lang = lang;
			_uri = uri;
			
			initThis();
		}
		
		private function initThis():void
		{
			container = new DragContainerBox(_stage.stageWidth,_stage.stageHeight * .82,_stage);
			container.y = _stage.stageHeight * ClientConstants.HOME_UP_PER;
			this.addChild(container);
			
			boxList = new GetMoreList(_stage,_loader,_lang,_uri);
		}
		
		public function clear():void
		{
			if(_stage){
				_stage = null;
				_loader = null;
				_lang = null;
				_uri = null;
				
				
			}
		}
	}
}